/**
 * org.assess.oa.system.dao.impl.TbRoleDAOImpl
 */
package org.assess.oa.system.dao.impl;

import java.util.List;
import java.util.Map;

import org.assess.core.dao.BaseDAOImpl;
import org.assess.oa.system.bean.TbRole;
import org.assess.oa.system.dao.TbRoleDAO;

/**
 * @description 操作角色信息的DAO层接口
 * @author XiaLongxiang
 * @createtime 2012-6-5 上午10:33:24
 */
public class TbRoleDAOImpl extends BaseDAOImpl<TbRole> implements TbRoleDAO {
    public TbRole queryTbRoleById(String role_id) {
        return (TbRole)sqlClient.queryForObject("queryTbRoleById", role_id);
    }
    
    public int queryTbRoleAsInt(Map<String, Object> parameters) {
        return (Integer)sqlClient.queryForObject("queryTbRoleAsInt", parameters);
    }
    
    @SuppressWarnings("unchecked")
    public List<TbRole> queryTbRoleAsList(int startNum, int rows, Map<String, Object> parameters) {
        if(rows <= 0) {
            return sqlClient.queryForList("queryTbRoleAsList", parameters);
        }
        else {
            return sqlClient.queryForList("queryTbRoleAsList", parameters, startNum, rows);
        }
    }
    
    public boolean deleteTbRoleById(String role_id) {
        sqlClient.delete("deleteTbRoleById", role_id);
        return true;
    }
}
